<%--
  Created by IntelliJ IDEA.
  User: bxc
  Date: 2018/9/5 0005
  Time: 23:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加新合同</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <style>
        .t1 {
            width: 120px;
            text-align:right;
        }

        .t2 {
            width: 300px;
        }

        span {
            color: red;
        }
    </style>
</head>
<body>
<form id="add_form" action="/rentsys/agreen/addAgreen?prid=${prid2}" method="post">
    <table>
        <tr>
            <td class="t1">起始时间: <span>*</span></td>
            <td class="t2"><input id="start" type="text" name="start_time"/></td>
        </tr>
        <tr>
            <td class="t1">结束时间: <span>*</span></td>
            <td class="t2"><input id="end" type="text" name="end_time"/></td>
        </tr>
        <tr>
            <td class="t1">收款周期: <span>*</span></td>
            <td>
                <select id="pay" name="pay_period">
                    <option class="o1" value="30">月</option>
                    <option class="o1" value="90">季度</option>
                    <option class="o1" value="182">半年</option>
                    <option class="o1" value="365">年</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="t1">租赁方式: <span>*</span></td>
            <td>
                <select id="rent" name="is_New_Deal">
                    <option class="o2" value="0">新租</option>
                    <option class="o2" value="1">续租</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="t1">保证金: <span>*</span></td>
            <td class="t2"><input id="prepay" type="text" name="prepay"/></td>
        </tr>
        <tr>
            <td class="t1">租赁单价: <span>*</span></td>
            <td class="t2"><input id="price" type="text" name="price"/>/平米</td>
        </tr>
        <tr>
            <td class="t1">免租期: <span>*</span></td>
            <td class="t2"><input id="free" type="text" name="free_period"/></td>
        </tr>
        <tr>
            <td class="t1">递增率: <span>*</span></td>
            <td class="t2"><input id="rate" type="text" name="rate_increase"/> %</td>
        </tr>
        <tr>
            <td class="t1">承租人: <span>*</span></td>
            <td class="t2"><input id="person" type="text" name="person"/></td>
        </tr>
        <tr>
            <td class="t1">承租人电话: <span>*</span></td>
            <td class="t2"><input id="phone" type="text" name="phone"/></td>
        </tr>
    </table>
    <br/><br/>
    <input id="add" type="submit" value="提交" style="margin-left: 100px"/><font color="green">${addmsg}</font>
   <%-- <input id="add" type="button" value="提交" onclick="addAgreen()"/>--%>
</form>



<%--<script>
    $("#pay").bind("change",function () {
        alert($(".o1:selected").val());
        var payperid = $(".o1:selected").val();
    });
    $("#rent").bind("change",function () {
        alert($(".o2:selected").val());
        var is_New_Deal = $(".o2:selected").val();
    });
    //var datas = $('#add_form').serialize();
    function addAgreen(){
        $.ajax({
            url:"/rent/agreen/addAgreen",
            type:"POST",
/*            data:{
              //  agreementDetail:{
                    start_Time:$("#start").val(),
                    end_Time:$("#end").val(),
                    pay_Period:payperid,
                    is_New_Deal:is_New_Deal,
                    prepay:$("#prepay").val(),
                    price:$("#price").val(),
                    free_Period:$("#free").val(),
                    rate_Increase:$("#rate").val(),
                    person:$("#person").val(),
                    phone:$("#phone").val()
               // }
            },*/
            dataType: 'json',
            /*contentType:"application/json;charset=utf-8",*/
            success: function (result) {
                if(result.errorCode == 202){
                    alert(result.errorMsg)
                }else {
                    alert("新合同添加失败！")
                }
            },
            error: function () {
                alert("请求失败！")
            }
        });
    }
</script>--%>
</body>
</html>
